{
    identifier: "id",
    label: "consultantServicesProvidedStore",
    items: [

<?php
include_once "src/controller/regmanagement/AccountManager.php";
include_once "src/model/Consultant.php";
include_once "src/model/ProvidedService.php";

try {
    $months = array();
    $months["0"] = "q";
    $months["01"] = "January";
    $months["02"] = "February";
    $months["03"] = "March";
    $months["04"] = "April";
    $months["05"] = "May";
    $months["06"] = "June";
    $months["07"] = "July";
    $months["08"] = "August";
    $months["09"] = "September";
    $months["10"] = "October";
    $months["11"] = "November";
    $months["12"] = "December";

    $user = AccountManager::getConsultant($_GET["email"]);

    $providedServices = $user->getServices();

    for ($i = 0; $i < count($providedServices); $i++) {
        $tempProvidedService = $providedServices[$i];

        $tempServiceSinceParseDate = explode("-", $tempProvidedService->getServingSince());

        $tempServingSince = $months[$tempServiceSinceParseDate[1]] . ", " . $tempServiceSinceParseDate[0];

        if ($i == 0) {
            echo '{ id:"' . $tempProvidedService->getServiceId() . '", service:"' . $tempProvidedService->getServiceName() . '", servingSince:"' . $tempServingSince . '" }';
        } else {
            echo ', { id:"' . $tempProvidedService->getServiceId() . '", service:"' . $tempProvidedService->getServiceName() . '", servingSince:"' . $tempServingSince . '" }';
        }
        
    }
    
} catch (Exception $e) {
    echo '{ id:"0", service:"' . $e->getMessage() . '", timeServed:"0" }';
}
?>
    ]
}